package com.dwms.feign.system;

import com.dwms.entity.CityAreaVO;
import com.dwms.entity.PageResponse;
import com.dwms.entity.QueryRequest;
import com.dwms.entity.Result;
import com.dwms.entity.system.city.area.request.CityAreaQueryRequest;
import com.dwms.entity.system.city.area.request.CityAreaRequest;
import com.dwms.entity.system.city.area.response.CityAreaResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @ClassName: CityAreaMapper
 * @Description: CityArea
 * @Create 2022/06/14 16:58
 * @Author WH
 * @Since 2.0.0
**/

@FeignClient(value = "system-server", path = "/cityArea")
public interface CityAreaFeignClient {

    /**
     * 新增城市地区
     * @param cityAreaRequest
     * @return
     */
    @PostMapping("/save")
    Result save(@RequestBody CityAreaRequest cityAreaRequest);

    /**
     * 修改城市地区
     * @param cityAreaRequest
     * @return
     */
    @PostMapping("/update")
    Result update(@RequestBody CityAreaRequest cityAreaRequest);

    /**
     * 分页查询城市地区
     * @param query
     * @return
     */
    @PostMapping("/findPage")
    Result<PageResponse<CityAreaResponse>> findPage(@RequestBody CityAreaQueryRequest query);

    /**
     * 根据ID查询城市地区
     * @param query
     * @return
     */
    @PostMapping("/findById")
    Result findById(@RequestBody QueryRequest query);

    /**
     * 删除城市地区
     * @param query
     * @return
     */
    @PostMapping("/delete")
    Result delete(@RequestBody QueryRequest query);

    /**
     * 查找树形地区
     * @return
     */
    @PostMapping("/findTree")
    Result<List<CityAreaVO>> findTree();
}
